﻿/**********************************************************************
 * @file   SemiInfiniteFluidConnectDialog.h
 * @brief  半无限流体的拾取
 * @author liuzhonghua (liuzhonghuaszch@163.com)
 * @date   2025-02-25
 *********************************************************************/
#ifndef _SemiInfiniteFluidConnectDialog_H
#define _SemiInfiniteFluidConnectDialog_H

#include "GUISubSystemDialogAPI.h"
#include "GUIWidget/GUIDialogBase.h"
#include "FITK_Kernel/FITKCore/FITKActionOperator.h"
#include "PickDataProvider/PickedData.h"

class QButtonGroup;

namespace Ui
{
    class SemiInfiniteFluidConnectDialog;
}

namespace Core
{
    class FITKActionOperator;
}

namespace Acoustics
{
    class FITKAbstractSEASubSys;
    class FITKAbstractSEASubSysShell;
}

namespace GUI
{
    /**
     * @brief FlatPlate create or edit widget
     * @author liuzhonghua (liuzhonghuaszch@163.com)
     * @date 2024-10-23
     */
    class GUISubSystemDialogAPI SemiInfiniteFluidConnectDialog :public GUIDialogBase
    {
        Q_OBJECT;
    public:
        /**
         * @brief create object
         * @param[i]  obj            My Param doc
         * @param[i]  oper           operator
         * @param[i]  parent
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-10-23
         */
        SemiInfiniteFluidConnectDialog(Core::FITKActionOperator* oper, QWidget* parent = nullptr);
        /**
         * @brief Destroy object
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-10-23
         */
        virtual ~SemiInfiniteFluidConnectDialog();

    protected slots:
        /**
         * @brief cencel button clicked slot
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-10-23
         */
        void on_pushButton_Cancel_clicked();
        /**
         * @brief ok button clicked slot
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-10-23
         */
        void on_pushButton_OK_clicked();
        /**
         * @brief    Pick radioButton clicked slot
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-02-25
         */
        void on_radioButton_Pick_clicked(bool state);
        /**
         * @brief    Group radioButton clicked slot
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-02-25
         */
        void on_radioButton_Group_clicked(bool state);
        /**
         * @brief    关闭槽
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-07
         */
        virtual void reject() override;

    protected:
        /**
         * @brief    初始化
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-12
         */
        void init();
        /**
         * @brief    初始化Group下拉框
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-02-25
         */
        void initGroupComboBox();
        /**
         * @brief    拾取完成处理
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-01
         */
        void pickFinished();
        /**
         * @brief    计算连接点坐标
         * @param[i] point
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-01
         */
        void calculateConnectPoint(GraphData::PickedFaceData pickData, double* point);
        /**
         * @brief    计算连接点坐标
         * @param[i] subData 
         * @param[i] point 
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-02-25
         */
        void calculateConnectPoint(Acoustics::FITKAbstractSEASubSysShell* subData, double* point);

    protected:
        /**
         * @brief ui object
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-10-23
         */
        Ui::SemiInfiniteFluidConnectDialog* _ui = nullptr;
        /**
         * @brief 操作器对象
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-10-23
         */
        Core::FITKActionOperator* _oper = nullptr;
    };
}

#endif
